<template>
    <div>
        <button @click="connect">链接钱包</button>
        <button >铸造NFT</button>
        <button >查看NFT</button>
    </div>
</template>

<script>
import {initialize,connectWallet} from "@/Utils/starcoin"
export default {
  name:"NFTHome",
  data(){
    return{

    }
  },
  methods:{
      async connect(){

        console.log("链接钱包....")
        try{
          let account =await connectWallet();
          console.log("链接成功,默认账户：",account)
        }catch (error){
          console.log("链接失败了，请尝试重新安装starmask")
        }

      }
  },
  mounted() {
    try{
      initialize();
    }
    catch (error){
      console.log(error)
      console.log("未安装StarMarks")
    }

  },
}
</script>

<style>

</style>